#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/9/18 10:55
# @Author  : youfeng


class DataStatus(object):
    # 没有采集到相关数据
    NOT_FOUND = 0

    # 成功
    SUCCESS = 1

    # 服务忙
    BUSY = 2

    # 失败
    FAIL = -1

    ERROR_MSG = {
        SUCCESS: "成功",
        BUSY: "任务队列已满，服务忙，请稍后再试!",
        FAIL: "数据采集异常!",
        NOT_FOUND: "当前未采集到该数据，请稍后再试!"
    }

    @classmethod
    def get_error_msg(cls, code):
        if code not in cls.ERROR_MSG:
            return "未知异常"

        return cls.ERROR_MSG[code]
